home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Text_Files / genrul.txt < prev    next >
Encoding:
Text File  |  1997-11-20  |  48.5 KB  |  784 lines

  1. /*************************/
  2. /*************************/////////////////////////////////////////////////////////////////////////////////
  3. /*************************///                                                                            
  4. /*************************///  IIIIIII SSSSSS                                                            
  5. /*************************///    II    SS                          InstallShield (R)                     
  6. /*************************///    II    SSSSSS      (c) 1996-1997, InstallShield Software Corporation     
  7. /*************************///    II        SS      (c) 1990-1996, InstallShield Corporation              
  8. /*************************///  IIIIIII SSSSSS                     All Rights Reserved.                   
  9. /*************************///                                                                            
  10. /*************************///                                                                            
  11. /*************************///  This code is generated as a starting setup template.  You should   
  12. /*************************///  modify it to provide all necessary steps for your setup.
  13. /*************************///                                                                            
  14. /*************************///                                                                            
  15. /*************************///    File Name:  Setup.rul                                                   
  16. /*************************///                                                                            
  17. /*************************///  Description:  InstallShield script                                        
  18. /*************************///                                                                            
  19. /*************************///     Comments:  This template script performs a basic setup on a     
  20. /*************************///                Windows 95 or Windows NT 4.0 platform. With minor           
  21. /*************************///                modifications, this template can be adapted to create       
  22. /*************************///                new, customized setups.
  23. /*************************///
  24. /*************************/////////////////////////////////////////////////////////////////////////////////
  25. /*************************/
  26. /*************************/
  27. /*************************/  // Include header file
  28. /*************************/#include "sdlang.h"   
  29. /*************************/#include "sddialog.h"
  30. /*************************/
  31. /*************************/////////////////////// string defines ////////////////////////////
  32. /*************************/
  33. /*************************/#define UNINST_LOGFILE_NAME      "Uninst.isu"
  34. /*************************/
  35. /*************************///////////////////// installation declarations ///////////////////
  36. /*************************/
  37. /*************************/  // ----- DLL prototypes -----
  38. /*************************/
  39. /*************************/
  40. /*************************/     // your DLL prototypes
  41. /*************************/
  42. /*************************/
  43. /*************************/  // ---- script prototypes -----
  44. /*************************/
  45. /*************************/     // generated
  46. /*************************/     prototype ShowDialogs();
  47. /*************************/     prototype MoveFileData();
  48. /*************************/     prototype HandleMoveDataError( NUMBER );
  49. /*************************/     prototype ProcessBeforeDataMove();
  50. /*************************/     prototype ProcessAfterDataMove();
  51. /*************************/     prototype SetupRegistry();
  52. /*************************/     prototype SetupFolders();
  53. /*************************/     prototype CleanUpInstall();
  54. /*************************/     prototype SetupInstall();
  55. /*************************/     prototype SetupScreen();
  56. /*************************/     prototype CheckRequirements();
  57. /*[sdwel]*****************/     prototype DialogShowSdWelcome();
  58. /*[sdlic]*****************/     prototype DialogShowSdLicense();
  59. /*[sdinfo]****************/     prototype DialogShowSdShowInfoList();
  60. /*[sdregx]****************/     prototype DialogShowSdRegisterUserEx();
  61. /*[sdadp]*****************/     prototype DialogShowSdAskDestPath();
  62. /*[sdstype]***************/     prototype DialogShowSdSetupType();
  63. /*[sdcd2]*****************/     prototype DialogShowSdComponentDialog2();
  64. /*[sdfldr]****************/     prototype DialogShowSdSelectFolder();
  65. /*[sdcfile]***************/     prototype DialogShowSdStartCopy();
  66. /*[sdfinr]****************/     prototype DialogShowSdFinishReboot();
  67. /*************************/
  68. /*************************/     // your prototypes
  69. /*************************/
  70. /*************************/
  71. /*************************/  // ----- global variables ------
  72. /*************************/
  73. /*************************/     // generated
  74. /*************************/     BOOL        bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
  75. /*************************/     STRING      svDir;
  76. /*************************/     STRING      svName, svCompany, svSerial;
  77. /*************************/     STRING      szAppPath;
  78. /*************************/     STRING      svSetupType;
  79. /*[sdcfile]***************/     LIST        listStartCopy;
  80. /*************************/
  81. /*************************/
  82. /*************************/     // your global variables
  83. /*************************/
  84. /*************************/
  85. /*************************////////////////////////////////////////////////////////////////////////////////
  86. /*************************///
  87. /*************************///   MAIN PROGRAM                                                            
  88. /*************************///
  89. /*************************///      The setup begins here by hiding the visible setup   
  90. /*************************///      window.  This is done to allow all the titles, images, etc. to   
  91. /*************************///      be established before showing the main window.  The following     
  92. /*************************///      logic then performs the setup in a series of steps.           
  93. /*************************///
  94. /*************************////////////////////////////////////////////////////////////////////////////////
  95. /*************************/program
  96. /*************************/    Disable( BACKGROUND );
  97. /*************************/
  98. /*************************/    CheckRequirements();
  99. /*************************/
  100. /*************************/    SetupInstall();
  101. /*************************/
  102. /*************************/    SetupScreen();
  103. /*************************/
  104. /*************************/    if (ShowDialogs()<0) goto end_install;
  105. /*************************/
  106. /*************************/    if (ProcessBeforeDataMove()<0) goto end_install;
  107. /*************************/
  108. /*************************/    if (MoveFileData()<0) goto end_install;
  109. /*************************/
  110. /*************************/    if (ProcessAfterDataMove()<0) goto end_install;
  111. /*************************/
  112. /*************************/    if (SetupRegistry()<0) goto end_install;
  113. /*************************/
  114. /*************************/    if (SetupFolders()<0) goto end_install;
  115. /*************************/
  116. /*************************/
  117. /*************************/  end_install:
  118. /*************************/
  119. /*************************/    CleanUpInstall();
  120. /*************************/
  121. /*************************/     // If an unrecoverable error occurred, clean up the partial installation.
  122. /*************************/     // Otherwise, exit normally.
  123. /*************************/
  124. /*************************/    if (bInstallAborted) then
  125. /*************************/        abort;
  126. /*************************/    endif;
  127. /*************************/
  128. /*************************/endprogram
  129. /*************************/
  130. /*************************////////////////////////////////////////////////////////////////////////////////
  131. /*************************///                                                                           //
  132. /*************************/// Function:  ShowDialogs                                                    //
  133. /*************************///                                                                           //
  134. /*************************///  Purpose:  This function manages the display and navigation               //
  135. /*************************///            the standard dialogs that exist in a setup.                    //
  136. /*************************///                                                                           //
  137. /*************************////////////////////////////////////////////////////////////////////////////////
  138. /*************************/function ShowDialogs()
  139. /*************************/    NUMBER  nResult;
  140. /*************************/ begin
  141. /*************************/
  142. /***********************:*/    $$$Dlg_Start$$$:
  143. /*************************/        // beginning of dialogs label
  144. /*************************/
  145. /*[sdwel]***************:*/    $$$Dlg_SdWelcome$$$:
  146. /*[sdwel]*****************/        nResult = DialogShowSdWelcome();
  147. /*[sdwel]***************:*/        if (nResult = BACK) goto $$$prevprev$$$;
  148. /*[sdwel]*****************/
  149. /*[sdlic]***************:*/    $$$Dlg_SdLicense$$$:
  150. /*[sdlic]*****************/        nResult = DialogShowSdLicense();
  151. /*[sdlic]***************:*/        if (nResult = BACK) goto $$$prevprev$$$;
  152. /*[sdlic]*****************/
  153. /*[sdinfo]**************:*/    $$$Dlg_SdShowInfoList$$$:
  154. /*[sdinfo]****************/        nResult = DialogShowSdShowInfoList();
  155. /*[sdinfo]**************:*/        if (nResult = BACK) goto $$$prevprev$$$;
  156. /*[sdinfo]****************/
  157. /*[sdregx]**************:*/    $$$Dlg_SdRegisterUserEx$$$:
  158. /*[sdregx]****************/        nResult = DialogShowSdRegisterUserEx();
  159. /*[sdregx]**************:*/        if (nResult = BACK) goto $$$prevprev$$$;
  160. /*[sdregx]****************/
  161. /*[sdadp]***************:*/    $$$Dlg_SdAskDestPath$$$:
  162. /*[sdadp]*****************/        nResult = DialogShowSdAskDestPath();
  163. /*[sdadp]***************:*/        if (nResult = BACK) goto $$$prevprev$$$;
  164. /*[sdadp]*****************/
  165. /*[sdstype]*************:*/    $$$Dlg_SdSetupType$$$:
  166. /*[sdstype]***************/        nResult = DialogShowSdSetupType();
  167. /*[sdstype]*************:*/        if (nResult = BACK) goto $$$prevprev$$$;
  168. /*[sdstype]***************/
  169. /*[sdcd2]***************:*/    $$$Dlg_SdComponentDialog2$$$:
  170. /*[sdcd2]*****************/        if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then
  171. /*[sdcd2]***************:*/           goto $$$prevprev$$$;
  172. /*[sdcd2]*****************/        endif;
  173. /*[sdcd2]*****************/        nResult = DialogShowSdComponentDialog2();
  174. /*[sdcd2]***************:*/        if (nResult = BACK) goto $$$prevprev$$$;
  175. /*[sdcd2]*****************/
  176. /*[sdfldr]**************:*/    $$$Dlg_SdSelectFolder$$$:
  177. /*[sdfldr]****************/        nResult = DialogShowSdSelectFolder();
  178. /*[sdfldr]**************:*/        if (nResult = BACK) goto $$$prevprev$$$;
  179. /*[sdfldr]****************/
  180. /*[sdcfile]*************:*/    $$$Dlg_SdStartCopy$$$:
  181. /*[sdcfile]***************/        nResult = DialogShowSdStartCopy();
  182. /*[sdcfile]*************:*/        if (nResult = BACK) goto $$$prevprev$$$;
  183. /*[sdcfile]***************/
  184. /*************************/    return 0;
  185. /*************************/
  186. /*************************/ end;
  187. /*************************/
  188. /*************************////////////////////////////////////////////////////////////////////////////////
  189. /*************************///                                                                           //
  190. /*************************/// Function: ProcessBeforeDataMove                                           //
  191. /*************************///                                                                           //
  192. /*************************///  Purpose: This function performs any necessary operations prior to the    //
  193. /*************************///           actual data move operation.                                     //
  194. /*************************///                                                                           //
  195. /*************************////////////////////////////////////////////////////////////////////////////////
  196. /*************************/function ProcessBeforeDataMove()
  197. /*************************/    STRING svLogFile;
  198. /*************************/    NUMBER nResult;
  199. /*************************/ begin
  200. /*************************/
  201. /*************************/  InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );
  202. /*************************/
  203. /*************************/  svLogFile = UNINST_LOGFILE_NAME;
  204. /*************************/
  205. /*************************/  nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
  206. /*************************/  if (nResult < 0) then
  207. /*************************/      MessageBox( @ERROR_UNINSTSETUP, WARNING );
  208. /*************************/  endif;
  209. /*************************/     
  210. /*************************/  szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir
  211. /*************************/     
  212. /*************************/  if ((bIs32BitSetup) && (bIsShellExplorer)) then 
  213. /*************************/      RegDBSetItem( REGDB_APPPATH, szAppPath );
  214. /*************************/      RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
  215. /*************************/      RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME );
  216. /*************************/  endif;
  217. /*************************/
  218. /*************************/  // TODO : update any items you want to process before moving the data
  219. /*************************/  //      
  220. /*************************/
  221. /*************************/  return 0;
  222. /*************************/ end;
  223. /*************************/
  224. /*************************////////////////////////////////////////////////////////////////////////////////
  225. /*************************///                                                                           //
  226. /*************************/// Function:  MoveFileData                                                   //
  227. /*************************///                                                                           //
  228. /*************************///  Purpose:  This function handles the data movement for                    //
  229. /*************************///            the setup.                                                     //
  230. /*************************///                                                                           //
  231. /*************************////////////////////////////////////////////////////////////////////////////////
  232. /*************************/function MoveFileData()
  233. /*************************/    NUMBER nResult, nDisk;
  234. /*************************/ begin
  235. /*************************/
  236. /*************************/  nDisk = 1;
  237. /*************************/  SetStatusWindow( 0, "" );
  238. /*************************/  Disable( DIALOGCACHE );
  239. /*************************/  Enable( STATUS );
  240. /*************************/  StatusUpdate( ON, 100 );
  241. /*************************/  nResult = ComponentMoveData( MEDIA, nDisk, 0 );
  242. /*************************/
  243. /*************************/  HandleMoveDataError( nResult );
  244. /*************************/
  245. /*************************/  Disable( STATUS );
  246. /*************************/
  247. /*************************/  return nResult;
  248. /*************************/
  249. /*************************/ end;
  250. /*************************/
  251. /*************************/
  252. /*************************////////////////////////////////////////////////////////////////////////////////
  253. /*************************///                                                                           //
  254. /*************************/// Function: HandleMoveDataError                                             //
  255. /*************************///                                                                           //
  256. /*************************///  Purpose: This function handles the error (if any) during the move data   //
  257. /*************************///           operation.                                                      //
  258. /*************************///                                                                           //
  259. /*************************////////////////////////////////////////////////////////////////////////////////
  260. /*************************/function HandleMoveDataError( nResult )
  261. /*************************/    STRING szErrMsg, svComponent , svFileGroup , svFile;
  262. /*************************/ begin
  263. /*************************/
  264. /*************************/  svComponent = "";
  265. /*************************/  svFileGroup = "";
  266. /*************************/  svFile = "";
  267. /*************************/
  268. /*************************/  switch (nResult)
  269. /*************************/  case 0:
  270. /*************************/       return 0;
  271. /*************************/  default:
  272. /*************************/       ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult );
  273. /*************************/       szErrMsg = @ERROR_MOVEDATA  + "\n\n" +
  274. /*************************/                  @ERROR_COMPONENT + " " + svComponent + "\n" +
  275. /*************************/                  @ERROR_FILEGROUP + " " + svFileGroup + "\n" +
  276. /*************************/                  @ERROR_FILE      + " " + svFile;
  277. /*************************/       SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult );
  278. /*************************/       bInstallAborted = TRUE;
  279. /*************************/       return nResult;
  280. /*************************/  endswitch;
  281. /*************************/
  282. /*************************/ end;
  283. /*************************/
  284. /*************************////////////////////////////////////////////////////////////////////////////////
  285. /*************************///                                                                           //
  286. /*************************/// Function: ProcessAfterDataMove                                            //
  287. /*************************///                                                                           //
  288. /*************************///  Purpose: This function performs any necessary operations needed after    //
  289. /*************************///           all data has been moved.                                        //
  290. /*************************///                                                                           //
  291. /*************************////////////////////////////////////////////////////////////////////////////////
  292. /*************************/function ProcessAfterDataMove()
  293. /*************************/ begin
  294. /*************************/
  295. /*************************/  // TODO : update self-registered files and other processes that
  296. /*************************/  //        should be performed after the data has been moved.
  297. /*************************/
  298. /*************************/
  299. /*************************/  return 0;
  300. /*************************/ end;
  301. /*************************/
  302. /*************************////////////////////////////////////////////////////////////////////////////////
  303. /*************************///                                                                           //
  304. /*************************/// Function: SetupRegistry                                                   //
  305. /*************************///                                                                           //
  306. /*************************///  Purpose: This function makes the registry entries for this setup.        //
  307. /*************************///                                                                           //
  308. /*************************////////////////////////////////////////////////////////////////////////////////
  309. /*************************/function SetupRegistry()
  310. /*************************/ NUMBER nResult;
  311. /*************************/
  312. /*************************/ begin
  313. /*************************/
  314. /*************************/  // TODO : Add all your registry entry keys here
  315. /*************************/  //
  316. /*************************/  //
  317. /*************************/  //    RegDBCreateKeyEx, RegDBSetKeyValueEx....
  318. /*************************/  //
  319. /*************************/
  320. /*************************/  nResult = CreateRegistrySet( "" );
  321. /*************************/
  322. /*************************/  return nResult;
  323. /*************************/ end;
  324. /*************************/
  325. /*************************////////////////////////////////////////////////////////////////////////////////
  326. /*************************/// 
  327. /*************************/// Function: SetupFolders                                                    
  328. /*************************/// 
  329. /*************************///  Purpose: This function creates all the folders and shortcuts for the  
  330. /*************************///           setup.  This includes program groups and items for Windows 3.1.    
  331. /*************************/// 
  332. /*************************////////////////////////////////////////////////////////////////////////////////
  333. /*************************/function SetupFolders()
  334. /*************************/ NUMBER nResult;
  335. /*************************/
  336. /*************************/ begin
  337. /*************************/
  338. /*************************/
  339. /*************************/  // TODO : Add all your folder (program group) along with shortcuts (program items)
  340. /*************************/  //
  341. /*************************/  //
  342. /*************************/  //    CreateProgramFolder, AddFolderIcon....
  343. /*************************/  //
  344. /*************************/
  345. /*************************/  nResult = CreateShellObjects( "" );
  346. /*************************/  
  347. /*************************/  return nResult;
  348. /*************************/ end;
  349. /*************************/
  350. /*************************////////////////////////////////////////////////////////////////////////////////
  351. /*************************///                                                                           //
  352. /*************************/// Function: CleanUpInstall                                                  //
  353. /*************************///                                                                           //
  354. /*************************///  Purpose: This cleans up the setup.  Anything that should                 //
  355. /*************************///           be released or deleted at the end of the setup should           //
  356. /*************************///           be done here.                                                   //
  357. /*************************///                                                                           //
  358. /*************************////////////////////////////////////////////////////////////////////////////////
  359. /*************************/function CleanUpInstall()
  360. /*************************/ begin
  361. /*************************/
  362. /*[sdcfile]***************/  ListDestroy( listStartCopy );   
  363. /*************************/
  364. /*************************/  if (bInstallAborted) then
  365. /*************************/      return 0;
  366. /*************************/  endif;
  367. /*************************/
  368. /*[sdfinr]****************/  DialogShowSdFinishReboot();
  369. /*[sdfinr]****************/
  370. /*************************/  if (BATCH_INSTALL) then // ensure locked files are properly written
  371. /*************************/      CommitSharedFiles(0);
  372. /*************************/  endif;
  373. /*************************/
  374. /*************************/  return 0;
  375. /*************************/ end;
  376. /*************************/
  377. /*************************////////////////////////////////////////////////////////////////////////////////
  378. /*************************///                                                                           //
  379. /*************************/// Function: SetupInstall                                                    //
  380. /*************************///                                                                           //
  381. /*************************///  Purpose: This will setup the installation.  Any general initialization   //
  382. /*************************///           needed for the installation should be performed here.           //
  383. /*************************///                                                                           //
  384. /*************************////////////////////////////////////////////////////////////////////////////////
  385. /*************************/function SetupInstall()
  386. /*************************/ begin
  387. /*************************/
  388. /*************************/  Enable( CORECOMPONENTHANDLING );
  389. /*************************/
  390. /*************************/  bInstallAborted = FALSE;
  391. /*[sdcfile]***************/
  392. /*[sdcfile]***************/  listStartCopy = ListCreate(STRINGLIST);   
  393. /*[sdcfile]***************/  
  394. /*[sdcfile]***************/  ListAddString( listStartCopy, "Place the summary here.", AFTER );
  395. /*************************/
  396. /*************************/  if (bIs32BitSetup) then
  397. /*************************/      svDir = PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME;
  398. /*************************/  else
  399. /*************************/      svDir = PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names
  400. /*************************/  endif;
  401. /*************************/
  402. /*************************/  TARGETDIR  = svDir;
  403. /*************************/
  404. /*************************/  SdProductName( @PRODUCT_NAME );
  405. /*************************/
  406. /*************************/  Enable( DIALOGCACHE );
  407. /*************************/
  408. /*************************/  return 0;
  409. /*************************/ end;
  410. /*************************/
  411. /*************************////////////////////////////////////////////////////////////////////////////////
  412. /*************************///                                                                           //
  413. /*************************/// Function:  SetupScreen                                                    //
  414. /*************************///                                                                           //
  415. /*************************///  Purpose:  This function establishes  the screen look.  This includes     //
  416. /*************************///            colors, fonts, and text to be displayed.                       //
  417. /*************************///                                                                           //
  418. /*************************////////////////////////////////////////////////////////////////////////////////
  419. /*************************/function SetupScreen()
  420. /*************************/ begin
  421. /*************************/
  422. /*************************/  Enable( FULLWINDOWMODE );
  423. /*************************/  Enable( INDVFILESTATUS ); 
  424. /*************************/  SetTitle( @TITLE_MAIN, 24, WHITE );
  425. /*************************/
  426. /*************************/  SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text.
  427. /*************************/
  428. /*************************/  Enable( BACKGROUND );
  429. /*************************/
  430. /*************************/  Delay( 1 );
  431. /*************************/ end;
  432. /*************************/
  433. /*************************////////////////////////////////////////////////////////////////////////////////
  434. /*************************///                                                                           //
  435. /*************************/// Function:  CheckRequirements                                              //
  436. /*************************///                                                                           //
  437. /*************************///  Purpose:  This function checks all minimum requirements for the          //
  438. /*************************///            application being installed.  If any fail, then the user       //
  439. /*************************///            is informed and the setup is terminated.                       //
  440. /*************************///                                                                           //
  441. /*************************////////////////////////////////////////////////////////////////////////////////
  442. /*************************/function CheckRequirements()
  443. /*************************/    NUMBER  nvDx, nvDy, nvResult;
  444. /*************************/    STRING  svResult;
  445. /*************************/
  446. /*************************/ begin
  447. /*************************/
  448. /*************************/  bWinNT           = FALSE;
  449. /*************************/  bIsShellExplorer = FALSE;
  450. /*************************/
  451. /*************************/  // Check screen resolution.
  452. /*************************/  GetExtents( nvDx, nvDy );
  453. /*************************/
  454. /*************************/  if (nvDy < 480) then
  455. /*************************/      MessageBox( @ERROR_VGARESOLUTION, WARNING );
  456. /*************************/      abort;
  457. /*************************/  endif;
  458. /*************************/
  459. /*************************/  // set 'setup' operation mode
  460. /*************************/  bIs32BitSetup = TRUE;
  461. /*************************/  GetSystemInfo( ISTYPE, nvResult, svResult );
  462. /*************************/  if (nvResult = 16) then
  463. /*************************/      bIs32BitSetup = FALSE; // running 16-bit setup
  464. /*************************/      return 0; // no additional information required
  465. /*************************/  endif;
  466. /*************************/
  467. /*************************/  // --- 32-bit testing after this point ---
  468. /*************************/
  469. /*************************/  // Determine the target system's operating system.
  470. /*************************/  GetSystemInfo( OS, nvResult, svResult );
  471. /*************************/
  472. /*************************/  if (nvResult =  IS_WINDOWSNT) then
  473. /*************************/      // Running Windows NT.
  474. /*************************/      bWinNT = TRUE;
  475. /*************************/
  476. /*************************/      // Check to see if the shell being used is EXPLORER shell.
  477. /*************************/      if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
  478. /*************************/          if (nvResult >= 4) then
  479. /*************************/              bIsShellExplorer = TRUE;
  480. /*************************/          endif;
  481. /*************************/      endif;
  482. /*************************/
  483. /*************************/  elseif (nvResult = IS_WINDOWS95 ) then
  484. /*************************/      bIsShellExplorer = TRUE;
  485. /*************************/
  486. /*************************/  endif;
  487. /*************************/
  488. /*************************/end;
  489. /*************************/
  490. /*************************/
  491. /*[sdwel]*****************////////////////////////////////////////////////////////////////////////////////
  492. /*[sdwel]*****************///                                                                           //
  493. /*[sdwel]*****************/// Function: DialogShowSdWelcome                                             //
  494. /*[sdwel]*****************///                                                                           //
  495. /*[sdwel]*****************///  Purpose: This function handles the standard welcome dialog.              //
  496. /*[sdwel]*****************///                                                                           //
  497. /*[sdwel]*****************///                                                                           //
  498. /*[sdwel]*****************////////////////////////////////////////////////////////////////////////////////
  499. /*[sdwel]*****************/function DialogShowSdWelcome()
  500. /*[sdwel]*****************/    NUMBER nResult;
  501. /*[sdwel]*****************/    STRING szTitle, szMsg;
  502. /*[sdwel]*****************/ begin
  503. /*[sdwel]*****************/
  504. /*[sdwel]*****************/  szTitle = "";
  505. /*[sdwel]*****************/  szMsg   = "";
  506. /*[sdwel]*****************/  nResult = SdWelcome( szTitle, szMsg );
  507. /*[sdwel]*****************/
  508. /*[sdwel]*****************/  return nResult;
  509. /*[sdwel]*****************/ end;
  510. /*[sdwel]*****************/
  511. /*[sdwel]*****************/
  512. /*[sdlic]*****************////////////////////////////////////////////////////////////////////////////////
  513. /*[sdlic]*****************///                                                                           //
  514. /*[sdlic]*****************/// Function: DialogShowSdLicense                                             //
  515. /*[sdlic]*****************///                                                                           //
  516. /*[sdlic]*****************///  Purpose: This function displays the license agreement dialog.            //
  517. /*[sdlic]*****************///                                                                           //
  518. /*[sdlic]*****************///                                                                           //
  519. /*[sdlic]*****************////////////////////////////////////////////////////////////////////////////////
  520. /*[sdlic]*****************/function DialogShowSdLicense()
  521. /*[sdlic]*****************/    NUMBER nResult;
  522. /*[sdlic]*****************/    STRING szTitle, szMsg, szQuestion, szLicenseFile;
  523. /*[sdlic]*****************/ begin
  524. /*[sdlic]*****************/
  525. /*[sdlic]*****************/  szLicenseFile = SUPPORTDIR ^ "license.txt";
  526. /*[sdlic]*****************/  szTitle    = "";
  527. /*[sdlic]*****************/  szMsg      = "";
  528. /*[sdlic]*****************/  szQuestion = "";
  529. /*[sdlic]*****************/  nResult    = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );
  530. /*[sdlic]*****************/
  531. /*[sdlic]*****************/  return nResult;
  532. /*[sdlic]*****************/ end;
  533. /*[sdlic]*****************/
  534. /*[sdlic]*****************/
  535. /*[sdinfo]****************////////////////////////////////////////////////////////////////////////////////
  536. /*[sdinfo]****************///                                                                           //
  537. /*[sdinfo]****************/// Function: DialogShowSdShowInfoList                                        //
  538. /*[sdinfo]****************///                                                                           //
  539. /*[sdinfo]****************///  Purpose: This function displays the general information list dialog.     //
  540. /*[sdinfo]****************///                                                                           //
  541. /*[sdinfo]****************///                                                                           //
  542. /*[sdinfo]****************////////////////////////////////////////////////////////////////////////////////
  543. /*[sdinfo]****************/function DialogShowSdShowInfoList()
  544. /*[sdinfo]****************/    NUMBER nResult;
  545. /*[sdinfo]****************/    LIST   list;
  546. /*[sdinfo]****************/    STRING szTitle, szMsg, szFile;
  547. /*[sdinfo]****************/ begin
  548. /*[sdinfo]****************/
  549. /*[sdinfo]****************/  szFile = SUPPORTDIR ^ "infolist.txt";
  550. /*[sdinfo]****************/
  551. /*[sdinfo]****************/  list = ListCreate( STRINGLIST );
  552. /*[sdinfo]****************/  ListReadFromFile( list, szFile );
  553. /*[sdinfo]****************/  szTitle  = "";
  554. /*[sdinfo]****************/  szMsg    = " ";
  555. /*[sdinfo]****************/  nResult  = SdShowInfoList( szTitle, szMsg, list );
  556. /*[sdinfo]****************/
  557. /*[sdinfo]****************/  ListDestroy( list );
  558. /*[sdinfo]****************/
  559. /*[sdinfo]****************/  return nResult;
  560. /*[sdinfo]****************/ end;
  561. /*[sdinfo]****************/
  562. /*[sdinfo]****************/
  563. /*[sdregx]****************////////////////////////////////////////////////////////////////////////////////
  564. /*[sdregx]****************///                                                                           //
  565. /*[sdregx]****************/// Function: DialogShowSdRegisterUserEx                                      //
  566. /*[sdregx]****************///                                                                           //
  567. /*[sdregx]****************///  Purpose: This function displays the user registration dialog.            //
  568. /*[sdregx]****************///                                                                           //
  569. /*[sdregx]****************///                                                                           //
  570. /*[sdregx]****************////////////////////////////////////////////////////////////////////////////////
  571. /*[sdregx]****************/function DialogShowSdRegisterUserEx()
  572. /*[sdregx]****************/    NUMBER nResult;
  573. /*[sdregx]****************/    STRING szTitle, szMsg;
  574. /*[sdregx]****************/ begin
  575. /*[sdregx]****************/
  576. /*[sdregx]****************/  
  577. /*[sdregx]****************/  svName    = "";
  578. /*[sdregx]****************/  svCompany = "";
  579. /*[sdregx]****************/
  580. /*[sdregx]****************/  szTitle = "";
  581. /*[sdregx]****************/  szMsg   = "";
  582. /*[sdregx]****************/  nResult = SdRegisterUserEx( szTitle, szMsg, svName, svCompany, svSerial );
  583. /*[sdregx]****************/
  584. /*[sdregx]****************/  return nResult;
  585. /*[sdregx]****************/ end;
  586. /*[sdregx]****************/
  587. /*[sdregx]****************/
  588. /*[sdadp]*****************////////////////////////////////////////////////////////////////////////////////
  589. /*[sdadp]*****************///                                                                           //
  590. /*[sdadp]*****************/// Function: DialogShowSdAskDestPath                                         //
  591. /*[sdadp]*****************///                                                                           //
  592. /*[sdadp]*****************///  Purpose: This function asks the user for the destination directory.      //
  593. /*[sdadp]*****************///                                                                           //
  594. /*[sdadp]*****************////////////////////////////////////////////////////////////////////////////////
  595. /*[sdadp]*****************/function DialogShowSdAskDestPath()
  596. /*[sdadp]*****************/    NUMBER nResult;
  597. /*[sdadp]*****************/    STRING szTitle, szMsg;
  598. /*[sdadp]*****************/ begin
  599. /*[sdadp]*****************/
  600. /*[sdadp]*****************/  szTitle = "";
  601. /*[sdadp]*****************/  szMsg   = "";
  602. /*[sdadp]*****************/  nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 );
  603. /*[sdadp]*****************/
  604. /*[sdadp]*****************/  TARGETDIR = svDir;
  605. /*[sdadp]*****************/
  606. /*[sdadp]*****************/  return nResult;
  607. /*[sdadp]*****************/ end;
  608. /*[sdadp]*****************/
  609. /*[sdadp]*****************/
  610. /*[sdstypeex]*************////////////////////////////////////////////////////////////////////////////////
  611. /*[sdstypeex]*************///                                                                           //
  612. /*[sdstypeex]*************/// Function: DialogShowSdSetupType                                           //
  613. /*[sdstypeex]*************///                                                                           //
  614. /*[sdstypeex]*************///  Purpose: This function displays the standard setup type dialog.          //
  615. /*[sdstypeex]*************///                                                                           //
  616. /*[sdstypeex]*************////////////////////////////////////////////////////////////////////////////////
  617. /*[sdstypeex]*************/function DialogShowSdSetupType()
  618. /*[sdstypeex]*************/    NUMBER nResult;
  619. /*[sdstypeex]*************/    STRING szTitle, szMsg;
  620. /*[sdstypeex]*************/ begin
  621. /*[sdstypeex]*************/
  622. /*[sdstypeex]*************/  if (svSetupType = "") then
  623. /*[sdstypeex]*************/      svSetupType = "Typical";
  624. /*[sdstypeex]*************/  endif;
  625. /*[sdstypeex]*************/
  626. /*[sdstypeex]*************/  szTitle = "";
  627. /*[sdstypeex]*************/  szMsg   = "";
  628. /*[sdstypeex]************/   nResult = SdSetupTypeEx( szTitle, szMsg, "", svSetupType, 0 );
  629. /*[sdstypeex]*************/
  630. /*[sdstypeex]*************/  return nResult;
  631. /*[sdstypeex]*************/ end;
  632. /*[sdstypeex]*************/
  633. /*[sdstypeex]*************/
  634. /*[sdstypestd]************////////////////////////////////////////////////////////////////////////////////
  635. /*[sdstypestd]************///                                                                           //
  636. /*[sdstypestd]************/// Function: DialogShowSdSetupType                                           //
  637. /*[sdstypestd]************///                                                                           //
  638. /*[sdstypestd]************///  Purpose: This function displays the standard setup type dialog.          //
  639. /*[sdstypestd]************///                                                                           //
  640. /*[sdstypestd]************////////////////////////////////////////////////////////////////////////////////
  641. /*[sdstypestd]************/function DialogShowSdSetupType()
  642. /*[sdstypestd]************/    NUMBER nResult, nType;
  643. /*[sdstypestd]************/    STRING szTitle, szMsg;
  644. /*[sdstypestd]************/ begin
  645. /*[sdstypestd]************/
  646. /*[sdstypestd]************/  switch (svSetupType) 
  647. /*[sdstypestd]************/  case "Typical":
  648. /*[sdstypestd]************/       nType = TYPICAL;
  649. /*[sdstypestd]************/  case "Custom":
  650. /*[sdstypestd]************/       nType = CUSTOM;
  651. /*[sdstypestd]************/  case "Compact":
  652. /*[sdstypestd]************/       nType = COMPACT;
  653. /*[sdstypestd]************/  case "":
  654. /*[sdstypestd]************/       svSetupType = "Typical";
  655. /*[sdstypestd]************/       nType = TYPICAL;
  656. /*[sdstypestd]************/  endswitch;
  657. /*[sdstypestd]************/
  658. /*[sdstypestd]************/  szTitle = "";
  659. /*[sdstypestd]************/  szMsg   = "";
  660. /*[sdstypestd]************/  nResult = SetupType( szTitle, szMsg, "", nType, 0 );
  661. /*[sdstypestd]************/
  662. /*[sdstypestd]************/  switch (nResult)
  663. /*[sdstypestd]************/  case COMPACT:
  664. /*[sdstypestd]************/       svSetupType = "Compact";
  665. /*[sdstypestd]************/  case TYPICAL:
  666. /*[sdstypestd]************/       svSetupType = "Typical";
  667. /*[sdstypestd]************/  case CUSTOM:
  668. /*[sdstypestd]************/       svSetupType = "Custom";
  669. /*[sdstypestd]************/  endswitch;
  670. /*[sdstypestd]************/
  671. /*[sdstypestd]************/  return nResult;
  672. /*[sdstypestd]************/ end;
  673. /*[sdstypestd]************/
  674. /*[sdstypestd]************/
  675. /*[sdcd2]*****************////////////////////////////////////////////////////////////////////////////////
  676. /*[sdcd2]*****************///                                                                           //
  677. /*[sdcd2]*****************/// Function: DialogShowSdComponentDialog2                                    //
  678. /*[sdcd2]*****************///                                                                           //
  679. /*[sdcd2]*****************///  Purpose: This function displays the custom component dialog.             //
  680. /*[sdcd2]*****************///                                                                           //
  681. /*[sdcd2]*****************///                                                                           //
  682. /*[sdcd2]*****************////////////////////////////////////////////////////////////////////////////////
  683. /*[sdcd2]*****************/function DialogShowSdComponentDialog2()
  684. /*[sdcd2]*****************/    NUMBER nResult;
  685. /*[sdcd2]*****************/    STRING szTitle, szMsg;
  686. /*[sdcd2]*****************/ begin
  687. /*[sdcd2]*****************/
  688. /*[sdcd2]*****************/  if ((svSetupType != "Custom") && (svSetupType != "")) then
  689. /*[sdcd2]*****************/      return 0;
  690. /*[sdcd2]*****************/  endif;
  691. /*[sdcd2]*****************/
  692. /*[sdcd2]*****************/  szTitle  = "";
  693. /*[sdcd2]*****************/  szMsg    = "";
  694. /*[sdcd2]*****************/  nResult  = SdComponentDialog2( szTitle, szMsg, svDir, "" );
  695. /*[sdcd2]*****************/
  696. /*[sdcd2]*****************/  return nResult;
  697. /*[sdcd2]*****************/ end;
  698. /*[sdcd2]*****************/
  699. /*[sdcd2]*****************/
  700. /*[sdfldr]****************////////////////////////////////////////////////////////////////////////////////
  701. /*[sdfldr]****************///                                                                           //
  702. /*[sdfldr]****************/// Function: DialogShowSdSelectFolder                                        //
  703. /*[sdfldr]****************///                                                                           //
  704. /*[sdfldr]****************///  Purpose: This function displays the standard folder selection dialog.    //
  705. /*[sdfldr]****************///                                                                           //
  706. /*[sdfldr]****************///                                                                           //
  707. /*[sdfldr]****************////////////////////////////////////////////////////////////////////////////////
  708. /*[sdfldr]****************/function DialogShowSdSelectFolder()
  709. /*[sdfldr]****************/    NUMBER nResult;
  710. /*[sdfldr]****************/    STRING szTitle, szMsg;
  711. /*[sdfldr]****************/ begin
  712. /*[sdfldr]****************/
  713. /*[sdfldr]****************/  if (SHELL_OBJECT_FOLDER = "") then
  714. /*[sdfldr]****************/      SHELL_OBJECT_FOLDER = @FOLDER_NAME;
  715. /*[sdfldr]****************/  endif;
  716. /*[sdfldr]****************/
  717. /*[sdfldr]****************/  szTitle    = "";
  718. /*[sdfldr]****************/  szMsg      = "";
  719. /*[sdfldr]****************/  nResult    = SdSelectFolder( szTitle, szMsg, SHELL_OBJECT_FOLDER );
  720. /*[sdfldr]****************/
  721. /*[sdfldr]****************/  return nResult;
  722. /*[sdfldr]****************/ end;
  723. /*[sdfldr]****************/
  724. /*[sdfldr]****************/
  725. /*[sdcfile]***************////////////////////////////////////////////////////////////////////////////////
  726. /*[sdcfile]***************///                                                                           //
  727. /*[sdcfile]***************/// Function: DialogShowSdStartCopy                                           //
  728. /*[sdcfile]***************///                                                                           //
  729. /*[sdcfile]***************///   Purpose: This function displays the dialog preceding the start of the   //
  730. /*[sdcfile]***************///            file copying process.                                          //
  731. /*[sdcfile]***************///                                                                           //
  732. /*[sdcfile]***************////////////////////////////////////////////////////////////////////////////////
  733. /*[sdcfile]***************/function DialogShowSdStartCopy()
  734. /*[sdcfile]***************/    NUMBER nResult;
  735. /*[sdcfile]***************/    STRING szTitle, szMsg;
  736. /*[sdcfile]***************/ begin
  737. /*[sdcfile]***************/  
  738. /*[sdcfile]***************/  szTitle = "";
  739. /*[sdcfile]***************/  szMsg   = "";
  740. /*[sdcfile]***************/  nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
  741. /*[sdcfile]***************/
  742. /*[sdcfile]***************/  return nResult;
  743. /*[sdcfile]***************/ end;
  744. /*[sdcfile]***************/
  745. /*[sdcfile]***************/
  746. /*[sdfinr]****************////////////////////////////////////////////////////////////////////////////////
  747. /*[sdfinr]****************///                                                                           //
  748. /*[sdfinr]****************/// Function: DialogShowSdFinishReboot                                        //
  749. /*[sdfinr]****************///                                                                           //
  750. /*[sdfinr]****************///  Purpose: This function will show the last dialog of the product.         //
  751. /*[sdfinr]****************///           It will allow the user to reboot and/or show some readme text.  //
  752. /*[sdfinr]****************///                                                                           //
  753. /*[sdfinr]****************////////////////////////////////////////////////////////////////////////////////
  754. /*[sdfinr]****************/function DialogShowSdFinishReboot()
  755. /*[sdfinr]****************/    NUMBER nResult, nDefOptions;
  756. /*[sdfinr]****************/    STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
  757. /*[sdfinr]****************/    NUMBER bOpt1, bOpt2;
  758. /*[sdfinr]****************/ begin
  759. /*[sdfinr]****************/
  760. /*[sdfinr]****************/  if (!BATCH_INSTALL) then
  761. /*[sdfinr]****************/      bOpt1 = FALSE;
  762. /*[sdfinr]****************/      bOpt2 = FALSE;
  763. /*[sdfinr]****************/      szMsg1 = "";
  764. /*[sdfinr]****************/      szMsg2 = "";
  765. /*[sdfinr]****************/      szOption1 = "";
  766. /*[sdfinr]****************/      szOption2 = "";
  767. /*[sdfinr]****************/      nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
  768. /*[sdfinr]****************/      return 0;
  769. /*[sdfinr]****************/  endif;
  770. /*[sdfinr]****************/
  771. /*[sdfinr]****************/  nDefOptions = SYS_BOOTMACHINE;
  772. /*[sdfinr]****************/  szTitle     = "";
  773. /*[sdfinr]****************/  szMsg1      = "";
  774. /*[sdfinr]****************/  szMsg2      = "";
  775. /*[sdfinr]****************/  nResult     = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );
  776. /*[sdfinr]****************/
  777. /*[sdfinr]****************/  return nResult;
  778. /*[sdfinr]****************/ end;
  779. /*[sdfinr]****************/
  780. /*************************/ // --- include script file section ---
  781. /*************************/
  782. /*************************/#include "sddialog.rul"
  783. /*************************/
  784.